package com.example.demo.service;

import com.example.demo.dao.ArticleMapper;
import com.example.demo.model.ArticleInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lishuo
 * Date: 2023-09-16
 * Time: 15:55
 */
@Service
public class ArticleService {
    @Autowired
    private ArticleMapper articleMapper;

    public List<ArticleInfo> getListByUid(int id) {
        return articleMapper.getListByUid(id);
    }

    public int del(Integer id,Integer uid) {
        return articleMapper.del(id,uid);
    }

    public int add(ArticleInfo articleInfo) {
        return articleMapper.add(articleInfo);
    }

    public ArticleInfo getArticleByidAnduid(int aid,int id) {
        return articleMapper.getArticleByidAnduid(aid,id);
    }

    public int update(ArticleInfo articleInfo) {
        return articleMapper.update(articleInfo);
    }

    public ArticleInfo getArticleById(int aid) {
        return articleMapper.getArticleById(aid);
    }

    public int getArtCount(int uid) {
        return articleMapper.getArtCount(uid);
    }

    public int increRcount(int aid) {
        return articleMapper.increRcount(aid);
    }

    public List<ArticleInfo> getListByPage(int finalLimit,int finalOffset) {
        return articleMapper.getListByPage(finalLimit,finalOffset);
    }

    public int getCount() {
        return articleMapper.getCount();
    }

}
